package com.zanglikun.apacheCommonUtil.apacheCommonIO;

import lombok.SneakyThrows;
import org.apache.commons.io.IOUtils;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * @author : zanglikun
 * @date : 2024/9/1 下午8:02
 * @desc : Copyright © zanglikun.com
 */
public class IOUtilsTest {
    @SneakyThrows
    public static void main(String[] args) {
        String targetPath = "D:\\b.txt";
        String path = IOUtilsTest.class.getResource("/a.txt").getPath();
        FileInputStream fileInputStream = new FileInputStream(path);
        FileOutputStream fileOutputStream = new FileOutputStream(targetPath);
        try {
            IOUtils.copy(fileInputStream, fileOutputStream);
        }catch (Exception e){

        }finally {
            IOUtils.closeQuietly(fileInputStream,fileOutputStream);
        }




    }
}
